package io.openaev.utils.fixtures;

import io.openaev.database.model.Vulnerability;
import java.math.BigDecimal;
import java.util.UUID;

public class VulnerabilityFixture {

  public static final String CVE_2023_48788 = "CVE-2023-48788";
  public static final String CVE_2025_5678 = "CVE-2025-5678";
  public static final String VULNERABILITY_EXTERNAL_ID = "CVE-2025-5679";
  public static final BigDecimal VULNERABILITY_CVSS_V31 = new BigDecimal("4.5");

  public static Vulnerability createVulnerabilityInput(String externalId) {
    Vulnerability input = new Vulnerability();
    input.setExternalId(externalId);
    input.setCvssV31(VULNERABILITY_CVSS_V31);
    return input;
  }

  public static String getRandomExternalVulnerabilityId() {
    return "CVE-%s".formatted(UUID.randomUUID());
  }
}
